Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dist state mgmt #90

Open
wants to merge 43 commits into
base: master
Choose a base branch
from

Conversation

sschwarzmann
Copy link
Contributor

Changes to fix GitHub CI actions:

  • change PhantomData::Default() to PhantomData as suggested by rustc

  • remove MIPS toolchain (removed in rust's default cross installation)

  • replace set_output by $GITHUB_OUTPUT

  • replace checkout@v2 by checkout@v4

  • replace GitHub's outdated rust actions-rs by dtolnay/rust-toolchain

  • The rustc 1.57 still causes troube

  • maybe also the actions from dtolnay/rust-toolchain

More infos in commits.

There's one change that may not be desired: the branch dist_state_mgmt is added for CI

lms.yml action/job shall also be triggered by this branch.
- Last change (replace "set-output" by $GITHUB_OUTPUT) caused an error.
- replace checkout@v2 by checkout@v4 due to
  https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
- contains just the module structure
- adapt lib.rs
Add "mod helper" to sst/mod.rs to integrate/build/test new file helper.rs.
For all "HssParameter"s, only one top part height for "dividing" one tree
is needed.
@aewag aewag self-requested a review December 20, 2023 09:43
Leave it to "sst_demo"-caller to provide different seeds.
- Use "REF_IMPL_MAX_ALLOWED_HSS_LEVELS" instead of magic number for max HSS size.
- Add new call argument for demo (two-step key generation)
Adapt LmsPrivateKey so the restricted number of leaves and
instance number can be considered.
Dep. on signing entity, tree height and division, calc. and
set first and last LMS leaf to limited values.
First set of arguments can optionally have top_height and entity_number.
If one is provided, the other is mandatory.
If not provided, behaviour is as previously (HSS).
- extension not written to file yet
- keys are used as before
- tests are still working
- 2 Bytes used for top_height and signing_entity
- calling with parameters 0/0 for those values
  results in same behaviour as before
- "node value" is the hash value calc. via get_tree_element()
  depending in the root node of the signing instance's single-sub-tree
- adapt AUX data: add level for signing entity nodes; ignore levels "above"
- generate the correct VerifyingKey: replace our own ID 1 "pubkey" value with node value calc. via intermediate SI nodes
- use separate files for different signing entities numbers (aux, prv, pub)
- extend arguments for demo code
- improve and clean up example code and API calls to lib code
- add adapted HssPublicKey "from()" method for SST to adapt AUX data,
- store other nodes intermediate data in AUX data
- use public key generated via signing entity intermediate nodes in HssPublicKey
- fix sst helper functions
- Generate keys for several signing entities (via parameter)
- provide number of signing instances instead of "top_div_height"
- provide SSTS parameter separately
- partially populate AUX data in gen key step 1
- read/use and extend AUX data in gen key step 2
- fix AUX data (finalize, write HMAC)
- adapt AUX arguments for py script and sst_demo
-
- fix for "tree identifier": the value needs to be the same for all signing entities
  - create tree ident. via first signing entity, then use this tree ident. for other entities
  - here the temp. solution is a fixed value for the treee ident.
- fix for "used leafs": the position of the used lefas value in the u64
  "CompressedUsedLeafsIndexes" and in the HSS levels array was wrong if several HSS levels were used
- build strings via f-string (improve readability)
- format code
- add requirements.txt (so far empty) to communicate python environment
- rename some constants, variables and functions to reflect their purpose
- remove obsolete comments
- remove unused functions
- format via "cargo fmt"
Simplification is possible because AUX data is filled before
calculating the "LmsPublicKey", so the "real" public key
can now be calculated straight via "LmsPublicKey" with index 1.

Before we used the LmsPublicKey with sst extension and index != 1 which
would result in the intermediate node value.
Use common tree identifier (RFC: "I") so that the key generation and signing
all use the same value (as opposed to using different values dep. on their
different seeds).
- rename "top_div_height" -> "l0_top_div"
- comments to indicate TODOs, review, questions...
All files under " res/nrf52-arm/".
See res/nrf52-arm/README.md for instructions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant